Explicitly set CJS format, inputs when compiling #154
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #153
In #152 we stopped bundling all dependencies in the package. As it turns out, bundling was ensuring an all-CJS format and it was incorporating not only external deps but relative files. By removing bundling and not explicitly marking the format as CJS we inadvertently introduced ESM syntax and omitted relative files. More info here.
This package doesn't support ESM yet (at least not intentionally), so this PR:
Testing
You can test that this fix works by first cloning and setting up this repo:
Then you can also clone this test repo I set up:
This test repo has the
op-js
codebase symlinked as a dependency, so if you've built it locally everything should be working as expected. By comparison, if you were to repeat these steps in theop-js
repo onmain
, it should fail.